/* GUI CONVERTED from rspoaiq.p (converter v1.75) Sat Aug 12 23:14:29 2000 */
/* rspoaiq.p - Release Management Supplier Schedules                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert rspoaiq.p (converter v1.00) Thu Feb 26 11:41:49 1998 */
/* web tag in rspoaiq.p (converter v1.00) Thu Feb 26 11:41:22 1998 */
/*F0PN*/ /*K1JZ*/ /*                                                    */
/*V8:ConvertMode=Report                                        */
/* REVISION: 7.3    LAST MODIFIED: 10/12/92           BY: WUG *G462*    */
/* REVISION: 7.3    LAST MODIFIED: 09/07/95           BY: vrn *G0WN*    */
/* REVISION: 7.3    LAST MODIFIED: 11/06/96           BY: *G2HS* Suresh Nayak */
/* REVISION: 8.6E   LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E   LAST MODIFIED: 02/26/98   BY: *K1JZ* Beena Mol            */
/* REVISION: 8.6E   LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan           */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb                  */

/* SCHEDULED PO EFFECTIVE ALLOCATION PERCENT INQUIRY */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rspoaiq_p_1 "Ship-To"
/* MaxLen: Comment: */

&SCOPED-DEFINE rspoaiq_p_2 "Effective"
/* MaxLen: Comment: */

&SCOPED-DEFINE rspoaiq_p_3 "Item Number"
/* MaxLen: Comment: */

&SCOPED-DEFINE rspoaiq_p_4 "Percent"
/* MaxLen: Comment: */

&SCOPED-DEFINE rspoaiq_p_5 "Purchase Order"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

define variable site as character label {&rspoaiq_p_1}.
define variable part like pt_part.
define variable effdate as date label {&rspoaiq_p_2}.
define variable po like po_nbr.
define variable begstr as character.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
space(1)
   site
   part colon 32
   effdate
   po   colon 32
with frame a width 80 attr-space side-labels NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K1JZ*/ {wbrp01.i}

repeat with frame a:

/*K1JZ*/ if c-application-mode <> 'web' then
   set site part effdate po with frame a editing:

      if frame-field = "site" then do:
         {mfnp05.i qad_wkfl qad_index1 "qad_key1 = ""poa_det""" qad_key2
         "input site"}

         if recno <> ? then do:
/*K1JZ* disp */
/*K1JZ*/ display
        qad_charfld[3] @ site
        qad_charfld[2] format "x(18)" @ part
        qad_datefld[1] @ effdate
        qad_charfld[1] @ po
        with frame a.
     end.
      end.
      else
      if frame-field = "part" then do:
         {mfnp05.i qad_wkfl qad_index1
         "qad_key1 = ""poa_det""
     and qad_key2 begins string(input site,""x(8)"")"
         qad_key2
         "string(input site,""x(8)"") + input part"}

         if recno <> ? then do:
/*K1JZ*  disp */
/*K1JZ*/ display
        qad_charfld[3] @ site
        qad_charfld[2] format "x(18)" @ part
        qad_datefld[1] @ effdate
        qad_charfld[1] @ po
        with frame a.
     end.
      end.
      else
      if frame-field = "effdate" then do:
         begstr = string(input site,"x(8)") + string(input part,"x(18)").

/*G2HS*/ {mfnp05.i qad_wkfl qad_index1
         "qad_key1 = ""poa_det""
     and qad_key2 begins begstr"
         qad_key2
         "begstr" }

/*G2HS** FOLLOWING SECTION COMMENTED TO CORRECT THE SOLVE 2000 PROBLEM AND
*    GETTING THE DATE AND THE MONTH USING SUBSTRING FUNCTION IS NOT
*    ALWAYS CORRECT AS DATE CAN BE ENTERED USING THE FORMAT DD/MM/YY OR
*    MM/DD/YY.
*        {mfnp05.i qad_wkfl qad_index1
*        "qad_key1 = ""poa_det""
*        and qad_key2 begins begstr"
*        qad_key2
*        "begstr
*        + string(int(substr(input effdate,7,2)) + 1900,""9999"")
*        + string(int(substr(input effdate,4,2)),""99"")
*        + string(int(substr(input effdate,1,2)),""99"")" }
*G2HS**/

         if recno <> ? then do:
/*K1JZ* disp */
/*K1JZ*/ display
        qad_charfld[3] @ site
        qad_charfld[2] format "x(18)" @ part
        qad_datefld[1] @ effdate
        qad_charfld[1] @ po
        with frame a.
     end.
      end.
      else
      if frame-field = "po" then do:
         begstr = string(input site,"x(8)") + string(input part,"x(18)")
         + string(year(input effdate),"9999")
     + string(month(input effdate),"99")
         + string(day(input effdate),"99").

         {mfnp05.i qad_wkfl qad_index1
         "qad_key1 = ""poa_det""
     and qad_key2 begins begstr"
         qad_key2
     "begstr + input po"}

         if recno <> ? then do:
/*K1JZ* disp */
/*K1JZ*/ display
        qad_charfld[3] @ site
        qad_charfld[2] format "x(18)" @ part
        qad_datefld[1] @ effdate
        qad_charfld[1] @ po
        with frame a.
     end.
      end.
      else do:
     status input.
     readkey.
     apply lastkey.
      end.
   end.

/*K1JZ*/ {wbrp06.i &command = set &fields = "  site part effdate po" &frm = "a"}

/*K1JZ*/ if (c-application-mode <> 'web') or
/*K1JZ*/ (c-application-mode = 'web' and
/*K1JZ*/ (c-web-request begins 'data')) then do:

   hide frame d1.
   hide frame d2.
   hide frame d3.
   hide frame d4.

/*K1JZ*/ end.

  {mfselprt.i terminal 80}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.


   if site > "" then do:
/*K1JZ* disp site part effdate po with frame a. */
/*K1JZ*/ display site part effdate po with frame a.

      for each qad_wkfl where qad_key1 = "poa_det"
      and (site = "" or qad_charfld[3] = site)
      and (part = "" or qad_charfld[2] = part)
      and (po = "" or qad_charfld[1] = po)
/*G0WN*  and (effdate = ? or qad_datefld[1] = effdate) */
/*G0WN*/ and (effdate = ? or qad_datefld[1] = effdate) no-lock
      break by qad_charfld[2] by qad_charfld[1] by qad_datefld[1]
      with frame d1 width 80:
     
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

/*K1JZ*  disp */
/* SET EXTERNAL LABELS */
setFrameLabels(frame d1:handle).
/*K1JZ*/  display
     qad_charfld[2] format "x(18)" label {&rspoaiq_p_3}
     qad_datefld[1] label {&rspoaiq_p_2}
     qad_charfld[1] format "x(22)" label {&rspoaiq_p_5}
     qad_decfld[1] format ">>9" label {&rspoaiq_p_4} WITH STREAM-IO /*GUI*/ .
      end.
   end.
   else
   if part > "" then do:
/*K1JZ*  disp site part effdate po with frame a. */
/*K1JZ*/  display site part effdate po with frame a.

      for each qad_wkfl where qad_key1 = "poa_det"
      and (site = "" or qad_charfld[3] = site)
      and (part = "" or qad_charfld[2] = part)
      and (po = "" or qad_charfld[1] = po)
/*G0WN*  and (effdate = ? or qad_datefld[1] = effdate) */
/*G0WN*/ and (effdate = ? or qad_datefld[1] = effdate) no-lock
      break by qad_charfld[3] by qad_charfld[1] by qad_datefld[1]
      with frame d2 width 80:
     
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

/*K1JZ*  disp */
/* SET EXTERNAL LABELS */
setFrameLabels(frame d2:handle).
/*K1JZ*/  display
     qad_charfld[3] label {&rspoaiq_p_1}
     qad_datefld[1] label {&rspoaiq_p_2}
     qad_charfld[1] format "x(22)" label {&rspoaiq_p_5}
     qad_decfld[1] format ">>9" label {&rspoaiq_p_4} WITH STREAM-IO /*GUI*/ .
      end.
   end.
   else
   if effdate <> ? then do:
/*K1JZ* disp site part effdate po with frame a. */
/*K1JZ*/ display site part effdate po with frame a.

      for each qad_wkfl where qad_key1 = "poa_det"
      and (site = "" or qad_charfld[3] = site)
      and (part = "" or qad_charfld[2] = part)
      and (po = "" or qad_charfld[1] = po)
/*G0WN*  and (effdate = ? or qad_datefld[1] = effdate) */
/*G0WN*/ and (effdate = ? or qad_datefld[1] = effdate) no-lock
      break by qad_charfld[3] by qad_charfld[2] by qad_charfld[1]
      with frame d3 width 80:
     
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

/*K1JZ*  disp */
/* SET EXTERNAL LABELS */
setFrameLabels(frame d3:handle).
/*K1JZ*/ display
     qad_charfld[3] label {&rspoaiq_p_1}
     qad_charfld[2] format "x(18)" label {&rspoaiq_p_3}
     qad_charfld[1] format "x(22)" label {&rspoaiq_p_5}
     qad_decfld[1] format ">>9" label {&rspoaiq_p_4} WITH STREAM-IO /*GUI*/ .
      end.
   end.
   else
   if po > "" then do:
/*K1JZ* disp site part effdate po with frame a.*/
/*K1JZ*/ display site part effdate po with frame a.

      for each qad_wkfl where qad_key1 = "poa_det"
      and (site = "" or qad_charfld[3] = site)
      and (part = "" or qad_charfld[2] = part)
      and (po = "" or qad_charfld[1] = po)
/*G0WN*  and (effdate = ? or qad_datefld[1] = effdate) */
/*G0WN*/ and (effdate = ? or qad_datefld[1] = effdate) no-lock
      break by qad_datefld[1]
      with frame d4 width 80:
     
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

/*K1JZ*  disp */
/* SET EXTERNAL LABELS */
setFrameLabels(frame d4:handle).
/*K1JZ*/  display
     qad_charfld[3] label {&rspoaiq_p_1}
     qad_charfld[2] format "x(18)" label {&rspoaiq_p_3}
     qad_datefld[1] label {&rspoaiq_p_2}
     qad_decfld[1] format ">>9" label {&rspoaiq_p_4} WITH STREAM-IO /*GUI*/ .
      end.
   end.

   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   {mfmsg.i 8 1}
end.

/*K1JZ*/ {wbrp04.i &frame-spec = a}
